<script>
  import $ from 'dfish-widget'
  import Method from '../Method.vue'

  export default {
    mixins: [Method],
    data() {
      return {
        name: '$.ajax.get(src, [config])',
        remark: '发送ajax请求，并返回一个promise',
        attrs: [{
          name: 'src',
          remark: '发送请求的地址',
          type: 'String',
        }, {
          name: 'config',
          type: 'Object',
          remark: '配置项。请参考 <a href=http://www.axios-js.com/zh-cn/docs/#axios-get-url-config-1 target=_blank>Axios配置</a>',
          attrs: []
        }],
        examples: [{
          remark: '发送Ajax请求',
          code: `
          $.ajax.get('data.sp?id=001')
            .then(data => {
              console.log(data)
            })`
        
        }]
      }
    }
  }
</script>
